package org.demo.restdocs.common;

public  class Result {
        private int code;
        private String message;
        private Object data;

        public int getCode() {
            return code;
        }

        public Result setCode(int code) {
            this.code = code;
            return this;
        }

        public String getMessage() {
            return message;
        }

        public Result setMessage(String message) {
            this.message = message;
            return this;
        }

        public Object getData() {
            return data;
        }

        public Result setData(Object data) {
            this.data = data;
            return this ;
        }

        public static Result success(){
            Result result = new Result();
            result.code = 1 ;
            result.message = "success";
            return result;
        }
        public static Result fail(){
            Result result = new Result();
            result.code = 0 ;
            result.message = "fail";
            return result;
        }
    }